{include file="default/base/header" /} 
<style>
body{
    background: #FFF;
}
 .page{
     min-height: auto;
 }
</style>
<div class="page">
<form method="post" name="remark_form" id="remark_form">
    <table class="ds-default-table nobdb">
            <tr> <input type="hidden" name="member_id" value="{$member_info.member_id}">
                <td><label>服务开始时间：</label></td>
                <td> <input  type="text" id="sdate" name="server_da_create_time" class="txt date" value="<?php if(isset($member_info)&&!empty($member_info['server_da_create_time'])){ echo date('Y-m-d',$member_info['server_da_create_time']); }?>"></td>
              </tr>
             <tr>
                <td><label>服务结束时间：</label></td>
                <td><input  type="text" id="edate" name="server_da_end_time" class="txt date" value="<?php if(isset($member_info)&&!empty($member_info['server_da_end_time'])){ echo date('Y-m-d',$member_info['server_da_end_time']); }?>"></td>
             </tr>
             <tr>
                <td><input type="submit" class="submit" value="提交"></td>
                <td></td>
              </tr>
        </table>
</form></div>


<script>

$('#sdate').datepicker({dateFormat: 'yy-mm-dd'});
$('#edate').datepicker({dateFormat: 'yy-mm-dd'});
  

$(document).ready(function(){
	$('form').submit(function(){
      var server_da_create_time = $("input[name='server_da_create_time']").val();
      if(server_da_create_time == ''){
            layer.msg('开始时间不能为空');return false;
      }
      var server_da_end_time = $("input[name='server_da_end_time']").val();
      if(server_da_end_time == ''){
      	 layer.msg('结束时间不能为空');return false;
      }
      var enddate = (new Date(server_da_end_time)).getTime() / 1000;
      var startdate = (new Date(server_da_create_time)).getTime() / 1000;
      var today = new Date();

      var dates = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 8, 0, 0).getTime() / 1000;
        if (enddate < dates) {
                layer.msg('结束时间不能小于今天');
                 return false;
                }
        if (startdate > enddate) {
                layer.msg('结束时间不能小于开始时间');
                 return false;
                }
	});
})

</script>
